/**
 * 最少操作使数组递增
 *
 * @USER: Administrator
 * @DATE: 2024/9/28 下午1:05
 * @VERSION: 1.0.0
 */
public class LC1827 {
    public static void main(String[] args) {

    }

    public int minOperations(int[] nums) {
        int result = 0;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i]<=nums[i-1]) {
                result += nums[i-1]-nums[i]+1;
                nums[i] = nums[i-1]+1;

            }
        }
        return result;
    }

}
